home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / calc16.zip / DEMO.PRG < prev    next >
Text File  |  1993-04-24  |  2KB  |  90 lines

  1.  
  2. /* Simple Demo of Calculator 1.5
  3.  
  4.    Compile using RT.BAT for RTLINK or
  5.               BLINK.BAT for BLINKER
  6.  
  7.    Manually:
  8.              Clipper DEMO /n/w
  9.  
  10.              Blinker fi DEMO lib CALC15
  11.           or RTLink  fi DEMO lib CALC15
  12.  
  13. */
  14.  
  15. #define F_BLOCKS  "█▀███▄██ "
  16.  
  17. #command CLS [with <char>] [color <color>]  ;
  18.       => @ 0,0,MaxRow(),MaxCol() Box If(<.char.>,Repl(<char>,9),"         ") ;
  19.          [Color <color>]
  20.  
  21.  
  22. #include "inkey.ch"
  23.  
  24. Function Demo()
  25. Local aColor, nVar1, nVar2, cVar1, GetList:={}
  26.  
  27.  
  28.    CalcReg(00000)                  //insert your reg. no. here
  29.    
  30.    SET KEY K_F5 TO CALCULATOR
  31.  
  32.  
  33.    //Set Environment
  34.    Set Scoreboard OFF
  35.    Set Confirm ON
  36.  
  37.    //Check Color
  38.    If IsColor()
  39.       aColor := {"W+/B,W/R,,,W/R","W/R","W/B,W/R,,,W/B"}
  40.    Else
  41.       aColor := {"W/N,N/W,,,W/N"}
  42.    Endif
  43.  
  44.    //Setup Screen
  45.    SetMode(25,80)
  46.    SetColor(aColor[1])
  47.    CLS with "▒" Color "W/N"
  48.    @ 0,0,MaxRow(),52 Box F_BLOCKS
  49.  
  50.    //Setup Values
  51.    nVar1 := 1
  52.    nVar2 := 1.23
  53.  
  54.    cVar1 := Space(10)
  55.  
  56.    @ 9,2 Say "      Integer Test:"
  57.    @ 9,22 Get nVar1 Color aColor[3]
  58.  
  59.    @10,2 Say "Fixed Decimal Test:"
  60.    @10,22 Get nVar2 Color aColor[3]
  61.  
  62.    @12,2 Say "    Character Test:"
  63.    @12,22 Get cVar1 Color aColor[3]
  64.  
  65.    SetColor(aColor[2])
  66.    @ 1,2,7,50 Box F_BLOCKS
  67.    @ 2,3 Say "Adding something as simple as:"
  68.    @ 3,3 Say "SET KEY K_F5 TO CALCULATOR" Color "+"+SetColor()
  69.    @ 4,3 Say "will allow all wait states access to "
  70.    @ 5,3 Say "the Calculator() and will allow *all*"
  71.    @ 6,3 Say "numerics and characters to receive the results:"
  72.  
  73.    @ 14,2,21,50 Box F_BLOCKS
  74.    @15,3 Say "After you press F5, notice that it holds the"
  75.    @16,3 Say "value of the variable.  After doing"
  76.    @17,3 Say "calculations you can press CTRL-ENTER to paste"
  77.    @18,3 Say "back the result."
  78.  
  79.    @20,3 Say "(Press H for Help in the Calculator)"
  80.  
  81.    SetColor(aColor[1])
  82.    Read
  83.  
  84.    SetColor("W/N")
  85.    Scroll(0,0,MaxRow(),MaxCol(),1)
  86.    SetCursor(1)
  87.    SetPos(MaxRow(),0)
  88.  
  89. Return NIL
  90.